const bcrypt = require('bcryptjs')

//生成哈希密码
exports.enctyption = (e) => {

    //生成随机数
    let salt = bcrypt.genSaltSync(10)
    //生成hash密码
    let hash = bcrypt.hashSync(e, salt)


    return hash
}

//解密
exports.verification = (e, hash) => {
    let verif = bcrypt.compareSync(e, hash)
    return verif
}